#ifndef __THREAD_H_
#define __THREAD_H_
#include<iostream>
#include<functional>
#include<string>

#include<pthread.h>
#include<unistd.h>

#include"Noncopyable.h"
#include"../../libs/Mylog.h"
using std::string;

namespace SC
{
    class Thread : Noncopyable
    {
    public:
        using ThreadCallBack = std::function<void()>;
        Thread(ThreadCallBack&&);
        ~Thread();

        void start();
        void join();
    private:
        static void* func(void* arg);

    private:
        pthread_t _pid;
        bool _isRunning;

        ThreadCallBack _cb;
    };
}
#endif